package com.qipay.sp;

import com.qipay.baas.model.Sp;
import com.qipay.core.entity.Pagination;
import com.qipay.sp.excutor.ExcutorFactory;

import java.util.List;

public interface SpService {
    int insert(Sp sp);

    int update(Sp sp);

    int delete(int id);

    Sp get(int id);

    List<Sp> all();

    ExcutorFactory getFactory(Long spid)
            throws ClassNotFoundException, IllegalAccessException, InstantiationException;

    ExcutorFactory getFactory(Sp sp)
            throws ClassNotFoundException, IllegalAccessException, InstantiationException;

    int updateState(int id, byte state);

    int updateDeleteFlag(int id);

    List<Sp> getByCondition(String name, String service, String bank, Byte state, int p, int pz,String spUserName);

    long countByCondition(String name, String service, String bank, Byte state,String spUserName);

    List<Sp> findByIdIn(List<Long> collect);

    /**
     * 分页查询供号商的Sp
     * @auth 游永年
     * @param userName   供号商的name
     * @param pagination 分页器
     * @return
     */
    List<Sp> findBySpUser(String userName, Pagination pagination);
}
